/* 
    设置 状态码 statusCode
    设置 响应头 Content-Type
*/

const http = require("http");

const server = http.createServer((request, response) => {
  response.statusCode = 200;
  //   自定义状态信息, 用的很少 [不能为中文]
  //   response.statusMessage = "bad!";

  response.setHeader("Content-Type", "text/plain; charset=utf-8");
  //   自定义内容 [不能为中文]
  response.setHeader("wqhash", "wqhash");
  response.end("nodejs 服务相应体!");
});

server.listen(3000, () => {
  console.log("开启3000服务!");
});
